home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: reversing a string
- Date: Fri, 12 Apr 96 12:23:52 GMT
- Organization: none
- Message-ID: <829311832snz@genesis.demon.co.uk>
- References: <4k6cjl$j8f@central.server.swt.edu> <4kgh5g$1ue@eccdb1.pms.ford.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4kgh5g$1ue@eccdb1.pms.ford.com>
- mbobak@pms991.uucp "Mark J. Bobak" writes:
-
- >In article <4k6cjl$j8f@central.server.swt.edu>,
- >Leland Newsom <ln16674@nyssa.swt.edu> wrote:
- >>I have a challenge from a friend of mine. He wanted me to reverse a string
- >>with recursion without using any additional variables or loops. I got mine
- >>to work by using exclusive or, but I needed an additional variable. Can
- >>someone help with this problem without using the additional variable?
- >>
- >>Thanks
- >
- >
- >Well, here's what I came up with....it seems to work.
- >
- >#include <stdio.h>
- >#include <string.h>
- >void revstr(char *string, int position)
-
- ^^^^^^^^^^^^
-
- The problem is that you are using an additional variable.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-